#####################################################################
# the build script for android libjingle
#

LOCAL_PATH:= $(call my-dir)

###########################################################
# the third prebuild library for linking
#
include $(CLEAR_VARS) 
LOCAL_MODULE := libssl-prebuild	
LOCAL_SRC_FILES := libssl.so
LOCAL_MODULE_TAGS := prebuild
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libcrypto-prebuild
LOCAL_SRC_FILES := libcrypto.so
LOCAL_MODULE_TAGS := prebuild
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libexpat-prebuild
LOCAL_SRC_FILES := libexpat.so
LOCAL_MODULE_TAGS := prebuild
include $(PREBUILT_SHARED_LIBRARY)



###########################################################
# build android libjingle itself
#
include $(CLEAR_VARS)
LOCAL_MODULE := libjingle

LOCAL_CPPFLAGS := -DHAMMER_TIME=1 -DLOGGING=1 -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DFEATURE_ENABLE_PSTN -DHAVE_SRTP -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -DHAVE_OPENSSL_SSL_H=1 -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DSRTP_RELATIVE_PATH -DXML_STATIC -DANDROID

LOCAL_C_INCLUDES :=  $(LOCAL_PATH)/third_party/include/expat $(LOCAL_PATH)/third_party/include $(LOCAL_PATH)/ ./

#including source files
include $(LOCAL_PATH)/talk/base/build.mk
include $(LOCAL_PATH)/talk/p2p/build.mk
include $(LOCAL_PATH)/talk/xmllite/build.mk
include $(LOCAL_PATH)/talk/xmpp/build.mk

LOCAL_SHARED_LIBRARIES := libcrypto-prebuild\
					    libssl-prebuild\
						libexpat-prebuild
LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

###########################################################
# the native testing application 
#
include $(CLEAR_VARS)
LOCAL_MODULE    := apptest
LOCAL_CPPFLAGS := -DHAMMER_TIME=1 -DLOGGING=1 -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DFEATURE_ENABLE_PSTN -DHAVE_SRTP -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -DHAVE_OPENSSL_SSL_H=1 -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DSRTP_RELATIVE_PATH -DXML_STATIC -DANDROID
LOCAL_SHARED_LIBRARIES := libcrypto-prebuild\
					    libssl-prebuild\
						libexpat-prebuild\
						libjingle

LOCAL_C_INCLUDES :=  $(LOCAL_PATH)/third_party/include/expat $(LOCAL_PATH)/third_party/include $(LOCAL_PATH)/ ./

include $(LOCAL_PATH)/app/build.mk

include $(BUILD_EXECUTABLE)


###########################################################
# the native jni interface library
#
include $(CLEAR_VARS)
LOCAL_MODULE    := jingle_jni
LOCAL_CPPFLAGS := -DHAMMER_TIME=1 -DLOGGING=1 -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DFEATURE_ENABLE_PSTN -DHAVE_SRTP -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -DHAVE_OPENSSL_SSL_H=1 -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DSRTP_RELATIVE_PATH -DXML_STATIC -DANDROID -DJNI_BASE
LOCAL_SHARED_LIBRARIES := libcrypto-prebuild\
					    libssl-prebuild\
						libexpat-prebuild\
						libjingle
LOCAL_C_INCLUDES :=  $(LOCAL_PATH)/third_party/include/expat $(LOCAL_PATH)/third_party/include $(LOCAL_PATH)/ ./
LOCAL_LDLIBS := -llog

include $(LOCAL_PATH)/app/build.mk

include $(BUILD_SHARED_LIBRARY)
